package viper

import (
	"fmt"
	"github.com/spf13/viper"
)

type ViperConfig struct {
	Nacos struct {
		Group  string
		DataId string
		Host   string
	}
}

var Conf ViperConfig

func Init() {
	viper.SetConfigFile("service/config/server.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		fmt.Println("配置文件读取失败")
	}
	err = viper.Unmarshal(&Conf)
	if err != nil {
		fmt.Println("配置文件解析失败")
	}

}
